﻿<?xml version="1.0" encoding="utf-8" ?>
<rules xmlns="http://transcriber.codeplex.com/Rules.xsd"
       title="Tengwar Numerals"
       author="Kirk"
       copyright="Open source distributed without warranties of any kind."
       caseSensitive="false"
       unmatchedAction="Omit"
       displayInUserInterface="false">

  <!--
  tengwar numerals require special treatment in that they can be in either decimal (base 10) or 
  duodecimal (base 12) and their digits are read in the opposite order (left to right) from
  arabic numerals (right to left)
  
  for these reasons, helper classes are used to programmatically transcribe numbers instead of
  relying on the text pattern replacement logic built in to the .NET Regex class
  -->

  <!-- duodecimal numbers -->
  <rule pattern="\|[0123456789ab]+\|">
    <!--
    a sequence of duodecimal digits surrounded by vertical bars will be transcribed as a duodecimal number
    
    the letters 'a' and 'b' are used as the duodecimal digits for decimal 10 and 11, respectively
    -->
    <final evaluator="Transcriber.Plugins.DuodecimalTengwarEvaluator"  />
  </rule>

  <!-- decimal numbers -->
  <rule pattern="[0123456789]+">
    <!--
    a sequence of decimal digits not surrounded by vertical bars wll be transcribed as a decimal number
    -->
    <final evaluator="Transcriber.Plugins.DecimalTengwarEvaluator"  />
  </rule>

</rules>